
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>

<HEAD>
   <TITLE>bodn2c_c</TITLE>
</HEAD>

<BODY style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<A name="TOP"></A>

<table style="text-align: left; margin-left: auto; margin-right: auto; width: 800px;"
 border="0" cellpadding="5" cellspacing="2">
  <tbody>
    <tr>
      <td style="background-color: rgb(153, 153, 153); vertical-align: middle; text-align: center;">
      <div align="right"> 
      <small><small><a href="index.html">Index Page</a></small></small>
      </div>
      <b>bodn2c_c</b> </td>
    </tr>

    <tr>
      <td style="vertical-align: top;">

<small><div align="center">
<A HREF="index.html#A">A</A>&nbsp;
<A HREF="index.html#B">B</A>&nbsp;
<A HREF="index.html#C">C</A>&nbsp;
<A HREF="index.html#D">D</A>&nbsp;
<A HREF="index.html#E">E</A>&nbsp;
<A HREF="index.html#F">F</A>&nbsp;
<A HREF="index.html#G">G</A>&nbsp;
<A HREF="index.html#H">H</A>&nbsp;
<A HREF="index.html#I">I</A>&nbsp;
<A HREF="index.html#J">J</A>&nbsp;
<A HREF="index.html#K">K</A>&nbsp;
<A HREF="index.html#L">L</A>&nbsp;
<A HREF="index.html#M">M</A>&nbsp;
<A HREF="index.html#N">N</A>&nbsp;
<A HREF="index.html#O">O</A>&nbsp;
<A HREF="index.html#P">P</A>&nbsp;
<A HREF="index.html#Q">Q</A>&nbsp;
<A HREF="index.html#R">R</A>&nbsp;
<A HREF="index.html#S">S</A>&nbsp;
<A HREF="index.html#T">T</A>&nbsp;
<A HREF="index.html#U">U</A>&nbsp;
<A HREF="index.html#V">V</A>&nbsp;
<A HREF="index.html#W">W</A>&nbsp;
<A HREF="index.html#X">X</A>&nbsp;
</div></small>
       <br>
       <table style="text-align: left; width: 60%; margin-left: auto; margin-right: auto;"
       border="0" cellspacing="2" cellpadding="2">
        <tbody>
          <tr>
            <td style="width: 50%; text-align: center;">
            <small>
              <a href="#Procedure">Procedure<br></a>
              <a href="#Abstract">Abstract<br></a>
              <a href="#Required_Reading">Required_Reading<br></a>
              <a href="#Keywords">Keywords<br></a>
              <a href="#Brief_I/O">Brief_I/O<br></a>
              <a href="#Detailed_Input">Detailed_Input<br></a>

              </small>
              </td>
              <td style="vertical-align: top; width: 50%; text-align: center;">
              <small>               <a href="#Detailed_Output">Detailed_Output<br></a>
              <a href="#Parameters">Parameters<br></a>
              <a href="#Exceptions">Exceptions<br></a>
              <a href="#Files">Files<br></a>
              <a href="#Particulars">Particulars<br></a>
              <a href="#Examples">Examples<br></a>

              </small>
              </td>
              <td style="vertical-align: top; width: 50%; text-align: center;">
              <small>               <a href="#Restrictions">Restrictions<br></a>
              <a href="#Literature_References">Literature_References<br></a>
              <a href="#Author_and_Institution">Author_and_Institution<br></a>
              <a href="#Version">Version<br></a>
              <a href="#Index_Entries">Index_Entries<br></a>
             </small>
            </td>
          </tr>
        </tbody>
</table>

<h4><a name="Procedure">Procedure</a></h4>
<PRE>
   void bodn2c_c ( ConstSpiceChar  * name,
                   SpiceInt        * code,
                   SpiceBoolean    * found )

</PRE>
<h4><a name="Abstract">Abstract</a></h4>
<PRE>
   Translate the name of a body or object to the corresponding SPICE
   integer ID code.
</PRE>
<h4><a name="Required_Reading">Required_Reading</a></h4>
<PRE>
   <a href="../req/naif_ids.html">NAIF_IDS</a>
</PRE>
<h4><a name="Keywords">Keywords</a></h4>
<PRE>
   BODY
   CONVERSION
   ID
   NAME


</PRE>
<h4><a name="Brief_I/O">Brief_I/O</a></h4>
<PRE>
   Variable  I/O  Description
   --------  ---  --------------------------------------------------
   name       I   Body name to be translated into a SPICE ID code.
   code       O   SPICE integer ID code for the named body.
   found      O   SPICETRUE if translated, otherwise SPICEFALSE.
</PRE>
<h4><a name="Detailed_Input">Detailed_Input</a></h4>
<PRE>
   name        is the name of a body or object, such as a planet,
               satellite, comet, asteroid, barycenter, DSN station,
               spacecraft, or instrument, that is &quot;known&quot; to the SPICE
               system, whether through hard-coded registration or
               run-time registration in the SPICE kernel pool.

               Case and leading and trailing blanks in `name'
               are not significant.  However when a name is made
               up of more than one word, they must be separated by
               at least one blank.  That is, all of the following
               strings are equivalent names:

                       &quot;JUPITER BARYCENTER&quot;
                       &quot;Jupiter Barycenter&quot;
                       &quot;JUPITER BARYCENTER   &quot;
                       &quot;JUPITER    BARYCENTER&quot;
                       &quot;   JUPITER BARYCENTER&quot;

               However, &quot;JUPITERBARYCENTER&quot; is not equivalent to
               the names above.
</PRE>
<h4><a name="Detailed_Output">Detailed_Output</a></h4>
<PRE>
   code        is the SPICE or user-defined integer ID code for the
               named body.

   found       is SPICETRUE if `name' has a translation.  Otherwise,
               `found' is SPICEFALSE.
</PRE>
<h4><a name="Parameters">Parameters</a></h4>
<PRE>
   None.
</PRE>
<h4><a name="Exceptions">Exceptions</a></h4>
<PRE>
   1) The error SPICE(EMPTYSTRING) is signaled if the input string
      `name' does not contain at least one character, since the input
      string cannot be converted to a Fortran-style string in this
      case.
      
   2) The error SPICE(NULLPOINTER) is signaled if the input string
      pointer `name' is null.
</PRE>
<h4><a name="Files">Files</a></h4>
<PRE>
   Body-name mappings may be defined at run time by loading text
   kernels containing kernel variable assignments of the form

      NAIF_BODY_NAME += ( &lt;name 1&gt;, ... )
      NAIF_BODY_CODE += ( &lt;code 1&gt;, ... )

   See NAIF_IDs for details.
</PRE>
<h4><a name="Particulars">Particulars</a></h4>
<PRE>
   <b>bodn2c_c</b> is one of five related subroutines,

      <a href="bods2c_c.html">bods2c_c</a>      Body string to code
      <a href="bodc2s_c.html">bodc2s_c</a>      Body code to string
      <b>bodn2c_c</b>      Body name to code
      <a href="bodc2n_c.html">bodc2n_c</a>      Body code to name
      <a href="boddef_c.html">boddef_c</a>      Body name/code definition

   <a href="bods2c_c.html">bods2c_c</a>, <a href="bodc2s_c.html">bodc2s_c</a>, <b>bodn2c_c</b>, and <a href="bodc2n_c.html">bodc2n_c</a> perform translations between 
   body names and their corresponding integer ID codes which are 
   used in SPICE files and routines.

   <a href="bods2c_c.html">bods2c_c</a> is a slightly more general version of <b>bodn2c_c</b>: support
   for strings containing ID codes in string format enables a caller
   to identify a body using a string, even when no name is
   associated with that body.

   <a href="bodc2s_c.html">bodc2s_c</a> is a general version of <a href="bodc2n_c.html">bodc2n_c</a>; the routine returns either
   the name assigned in the body ID to name mapping or a string
   representation of the CODE value if no mapping exists.

   <a href="boddef_c.html">boddef_c</a> assigns a body name to ID mapping. The mapping has priority 
   in name-to-ID and ID-to-name translations.

   Programmers writing user interface code should consider using the
   CSPICE routine <a href="bods2c_c.html">bods2c_c</a>. <a href="bods2c_c.html">bods2c_c</a> provides more flexibility in
   handling input strings, since it accepts both body names and
   strings representing integer ID codes, for example &quot;399&quot;.

   Refer to NAIF_IDs for the list of name/code associations built into
   SPICE, and for details concerning adding new name/code
   associations at run time by loading text kernels.
</PRE>
<h4><a name="Examples">Examples</a></h4>
<PRE>
   1)  In the following code fragment, <a href="bodvcd_c.html">bodvcd_c</a> returns the radii
       of Jupiter.  <a href="bodvcd_c.html">bodvcd_c</a> requires the SPICE integer ID code
       for Jupiter, so we use <b>bodn2c_c</b> to convert the name to its
       corresponding integer ID code.

 
          <b>bodn2c_c</b> ( &quot;JUPITER&quot;, &amp;jupid, &amp;found );

          <a href="bodvcd_c.html">bodvcd_c</a> ( jupid, &quot;RADII&quot;, 3, &amp;n, radii );


   2)  In this example, we assume that only the set of default 
       name/code pairs has been defined.

       Given these names, <b>bodn2c_c</b> will return the following codes:

          Name                         Code    Found?
          ------------------------   ------    ------
          &quot;EARTH&quot;                       399    Yes
          &quot;  Earth &quot;                    399    Yes
          &quot;EMB&quot;                           3    Yes
          &quot;Solar System Barycenter&quot;       0    Yes
          &quot;SolarSystemBarycenter&quot;         -    No
          &quot;SSB&quot;                           0    Yes
          &quot;Voyager 2&quot;                   -32    Yes
          &quot;U.S.S. Enterprise&quot;             -    No
          &quot; &quot;                             -    No
          &quot;Halley's Comet&quot;                -    No


       Given these codes, <a href="bodc2n_c.html">bodc2n_c</a> will return the following names:

          Code        Name                        Found?
          -------     -------------------         ------
          399         &quot;EARTH&quot;                     Yes
            0         &quot;SOLAR SYSTEM BARYCENTER&quot;   Yes
            3         &quot;EARTH BARYCENTER&quot;          Yes
          -77         &quot;GALILEO ORBITER&quot;           Yes
           11          -                          No
</PRE>
<h4><a name="Restrictions">Restrictions</a></h4>
<PRE>
   None.
</PRE>
<h4><a name="Literature_References">Literature_References</a></h4>
<PRE>
   None.
</PRE>
<h4><a name="Author_and_Institution">Author_and_Institution</a></h4>
<PRE>
   C.H. Acton      (JPL)
   N.J. Bachman    (JPL)
   K.R. Gehringer  (JPL)
   B.V. Semenov    (JPL)
</PRE>
<h4><a name="Version">Version</a></h4>
<PRE>
   -CSPICE Version 2.1.6, 16-MAY-2009 (EDW) 

       Edit to Particulars section to document the <a href="bodc2s_c.html">bodc2s_c</a> routine.

   -CSPICE Version 2.1.5, 27-FEB-2008 (BVS)

       Corrected the contents of the Required_Reading section of 
       the header.

   -CSPICE Version 2.1.4, 31-JAN-2008 (NJB)

       References to the routine <a href="bods2c_c.html">bods2c_c</a> were added to the header.

   -CSPICE Version 2.1.3, 27-OCT-2005 (NJB) 

       Header update:  replaced references to <a href="bodvar_c.html">bodvar_c</a> with 
       references to <a href="bodvcd_c.html">bodvcd_c</a>.

   -CSPICE Version 2.1.2, 23-JUL-2004 (NJB) 

      Header correction:  Exceptions section was updated to document
      input string error handling.

   -CSPICE Version 2.1.1, 28-JUL-2003 (NJB) 

      Various header changes were made to improve clarity.  Some
      minor header corrections were made.

   -CSPICE Version 2.1.0, 02-SEP-1999 (NJB)  
   
      Local type logical variable now used for found flag used in
      interface of bodn2c_.
            
   -CSPICE Version 2.0.2, 25-MAR-1998 (EDW)
     
      Minor corrections to header.

   -CSPICE Version 2.0.1, 08-FEB-1998 (EDW)

       Corrected and clarified header entries.

   -CSPICE Version 2.0.0, 06-JAN-1998 (NJB)

       The type of the input argument name was changed to
       ConstSpiceChar *.

       References to C2F_CreateStr_Sig were removed; code was
       cleaned up accordingly.  String checks are now done using
       the macro CHKFSTR.

   -CSPICE Version 1.0.0, 25-OCT-1997 (NJB)

      Based on SPICELIB Version 1.0.0, 23-JAN-1996 (KRG)
</PRE>
<h4><a name="Index_Entries">Index_Entries</a></h4>
<PRE>
   body name to code
</PRE>
<h4>Link to routine bodn2c_c source file <a href='../../../src/cspice/bodn2c_c.c'>bodn2c_c.c</a> </h4>

      </td>
    </tr>
  </tbody>
</table>

   <pre>Wed Jun  9 13:05:19 2010</pre>

</body>
</html>

